﻿Ext.define('app.prm.detail.North', {
    extend: 'Ext.panel.Panel',
    region: 'north',
    split: false,
    border: true,
    projectId: 0,
    tbar: [],
    bodyStyle: 'padding:5px',
    initComponent: function () {
        var me = this;
        me.items = [
            new Ext.panel.Panel({
                border: false,
                bind: {
                    html: '<b>{projectName}({projectNo} / {productNo})</b>'
                }
            }),
            new Ext.layout.container.Container({
                anchor: '100%',
                style: 'margin:10px 0 10px 0',
                layout: 'hbox',
                items: [
                {
                    xtype: 'progressbar',
                    bind: {
                        //text: '{formatPlanProgress}',
                        value: '{planProgress}'
                    },
                    flex: 8
                },
                new Ext.panel.Panel(
                {
                    border: false,
                    flex: 2,
                    style: 'margin:0 0 0 10px',
                    bind: {
                        html: '计划开始 - 计划完成：{planStartDate} - {planEndDate}'
                    }
                })]
            }),
            new Ext.layout.container.Container({
                anchor: '100%',
                layout: 'hbox',
                items: [
                {
                    xtype: 'progressbar',
                    flex: 8,
                    bind: {
                        //text: '{formatPlanProgress}',
                        value: '{actualProgress}'
                    }
                },
                {
                    border: false,
                    flex: 2,
                    style: 'margin:0 0 0 10px',
                    bind: {
                        html: '实际开始 - 预期完成：{actualStartDate} - {actualEndDate}'
                    }
                }
                ]
            })
        ];
        me.tbar = [
            "->",
            { text: '项目计划', handler: function () { window.open('/Gannt/Home/Index'); } },
            { text: '项目文档', handler: 'onOpenDocument' },
            //{
            //    text: '成员评价', handler: 'onTeamComment'
            //},
            //{
            //    text: '项目评价', handler: function () {
            //        var win = Ext.create("app.prm.detail.PrmEvaluation");
            //        win.show();
            //    }
            //},
            { text: '项目讨论', handler: 'onDiscuss' }
        ];
        me.callParent();
    }
})